<html>

<head>

<?php

include "../includes/constants.php";
include "../includes/functions.php";
@include "../includes/profile.php";

if ($_GET["id"]) {
	echo "<title>EQ Emu - " . $Profile[name] . "'s AA</title>\n";
} else {echo "<title>EQ Emu - Character AA</title>\n";};

if ((!isset($_GET[type])) || $_GET[type] == "") $_GET[type] = 1;
if ((!isset($_GET["class"])) || $_GET["class"] == "") $_GET["class"] = 1;

?>

<link rel="stylesheet" type="text/css" href="aa.css">

</head>

<body>

<table border="1" cellpadding="0">
	<tr>
		<td nowrap id="<?php if ($_GET["type"] == 1) {echo "CategoryAct";} else {echo "CategoryInact";};?>"><a href="?type=1&id=<?php echo $_GET["id"];?>&class=<?php echo $_GET["class"];?>">General</a></td>
		<td nowrap id="<?php if ($_GET["type"] == 2) {echo "CategoryAct";} else {echo "CategoryInact";};?>"><a href="?type=2&id=<?php echo $_GET["id"];?>&class=<?php echo $_GET["class"];?>">Archetype</a></td>
		<td nowrap id="<?php if ($_GET["type"] == 3) {echo "CategoryAct";} else {echo "CategoryInact";};?>"><a href="?type=3&id=<?php echo $_GET["id"];?>&class=<?php echo $_GET["class"];?>">Class</a></td>
		<td nowrap id="<?php if ($_GET["type"] == 4) {echo "CategoryAct";} else {echo "CategoryInact";};?>"><a href="?type=4&id=<?php echo $_GET["id"];?>&class=<?php echo $_GET["class"];?>">PoP Advance</a></td>
		<td nowrap id="<?php if ($_GET["type"] == 5) {echo "CategoryAct";} else {echo "CategoryInact";};?>"><a href="?type=5&id=<?php echo $_GET["id"];?>&class=<?php echo $_GET["class"];?>">PoP Ability</a></td>
		<td nowrap id="<?php if ($_GET["type"] == 6) {echo "CategoryAct";} else {echo "CategoryInact";};?>"><a href="?type=6&id=<?php echo $_GET["id"];?>&class=<?php echo $_GET["class"];?>">Gates</a></td>
		<td nowrap id="<?php if ($_GET["type"] == 7) {echo "CategoryAct";} else {echo "CategoryInact";};?>"><a href="?type=7&id=<?php echo $_GET["id"];?>&class=<?php echo $_GET["class"];?>">Omens</a></td>
		<td rowspan="3" valign="top">
			<br>
			<br>
			<center>Exp to AA<br>
			<?php echo $ExtProfile["perAA"]?>%<br>
			<br>
			AA Exp<br>
			<?php echo $Profile["expAA"];?></center><br>
			<br>
			AA Points: <?php echo $Profile["aapoints"];?><br>
			<br>
			Points Spent: <?php echo $Profile["aapoints_spent"];?><br>
			<br>
			<br>
			<center><button disabled>Train</button><br>
			<br>
			<button disabled>Hotkey</button><br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<br>
			<button onclick="window.close()">Done</button><br>
			<br>
			</center><br>
		</td>
	</tr>
	<tr>
		<td colspan="7" valign="top">
			<table width="100%" border="0" cellpadding="0">
				<tr>
					<td><font color="#8aa3ff">Title</font></td>
					<td align="center"><font color="#8aa3ff">Cur/Max</font></td>
					<td align="center"><font color="#8aa3ff">Cost</font></td>
				</tr>
<?php

//$query = "SELECT a.skill_id, a.name, a.cost, a.max_level, a.spellid, (a.classes + a.berserker) AS classes, d.text FROM altadv_vars a, dbstr_us d WHERE a.skill_id=d.id1 AND d.id2='4' AND a.type='" . $_GET[type] . "' AND classes & '" . $ClassesBit[$_GET["class"]] . "' ORDER BY a.skill_id";
$query = "SELECT a.skill_id, a.name, a.cost, a.max_level, a.spellid, (a.classes + a.berserker) AS classes FROM altadv_vars a WHERE a.type='" . $_GET[type] . "' AND classes & '" . $ClassesBit[$_GET["class"]] . "' ORDER BY a.skill_id";
$result = mysql_query($query,$db);

if ($db_row = mysql_fetch_array($result)) {
	do {
		if (GetCurrAA($db_row[skill_id]) >= $db_row[max_level]) {$CSSclass = "SkillMax";}
		else {$CSSclass = "SkillOff";};
		echo "\t\t\t\t<tr class=\"" . $CSSclass . "\" onMouseOver=\"this.className='SkillOn'\" onMouseOut=\"this.className='" . $CSSclass . "'\">
					<td><a href=\"javascript:void(0)\" onclick=\"AAAbilityInfo.value = '" . rtrim($db_row[text]) . "'; blur()\">" . $db_row[name] . "</a></td>
					<td align=\"center\">" . GetCurrAA($db_row[skill_id]) . "/" . $db_row[max_level] . "</td>
					<td align=\"center\">" . $db_row["cost"] . "</td>
				</tr>\n";
	} while ($db_row = mysql_fetch_array($result));
};

?>
			</table>
		</td>
	</tr>
	<tr valign="bottom">
		<td colspan="7">
			<textarea name="AAAbilityInfo" cols="51" rows="5" readonly>Click an ability's name for more information.
Press "Train" to train the selected ability.
Press "Hotkey" to make a hotkey for the selected ability.
			</textarea>
		</td>
	</tr>
</table>

</body>

</html>